package com.qf.business.student.controller;


import com.qf.business.student.service.StudentService;
import com.qf.commons.domain.base.R;
import com.qf.commons.domain.student.Student;
import com.qf.commons.web.base.BaseController;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 学生表(Student)表控制层
 *
 * @author makejava
 * @since 2023-09-01 20:51:04
 */
@RestController
@RequestMapping("student")
@Tag(name = "学生模块接口", description = "主要对学生数据进行统一管理")
public class StudentController extends BaseController<StudentService> {

    /**
     * 学生新增
     * @return
     */
    @PostMapping("/insert")
    @Operation(summary = "学生新增", description = "新增一个学生信息到数据库")
    @Parameters({
            @Parameter(name = "student", description = "学生实体", required = true, in = ParameterIn.PATH)
    })
    public R<Student> insert(Student student){
        System.out.println("学生对象：" + student);
        getBaseService().save(student);
        return R.succ();
    }
}

